<%+cbi/valueheader%>
<textarea id="logview" class="cbi-input-textarea" style="width: 100%" rows="30" readonly="readonly"></textarea>

<script type="text/javascript">
    const LOG_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","realtime_log")%>';

    //获取实时日志
    XHR.poll(1, LOG_URL, null, (x, d) => {
        let logview = document.getElementById("logview");
        if (!d.running) {
            XHR.halt();
        }
        logview.value = d.log;
        logview.scrollTop = logview.scrollHeight;
    });
</script>
<%+cbi/valuefooter%>
